<!DOCTYPE html>




<html class="theme-next mist" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">



  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.2" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="入门,kali,漏洞扫描," />








  <link rel="shortcut icon" type="image/x-icon" href="/images/favicon-16x16-next.png?v=5.1.2" />






<meta name="description" content="发现漏洞 基于端口服务扫描结果版本信息（速度慢） 搜索已公开的漏洞数据库（数量大） 使用弱点扫描器实现漏洞管理  从信息的维度定义漏洞管理信息收集： 扫描发现网络IP、OS、服务、配置、漏洞 能力需求：定义扫描方式内容和目标信息管理 格式化信息，并进行筛选、分组、定义优先级 能力需求：资产分组、指定所有者、向所有者报告漏洞信息输出 向不同层级的人群展示足够的信息量 能力需求：生成报告、导出数据、与">
<meta name="keywords" content="入门,kali,漏洞扫描">
<meta property="og:type" content="article">
<meta property="og:title" content="Kali-linux漏洞扫描入门">
<meta property="og:url" content="http://xchcloud.cn/Kali-linux漏洞扫描入门/index.html">
<meta property="og:site_name" content="超哥记录日记">
<meta property="og:description" content="发现漏洞 基于端口服务扫描结果版本信息（速度慢） 搜索已公开的漏洞数据库（数量大） 使用弱点扫描器实现漏洞管理  从信息的维度定义漏洞管理信息收集： 扫描发现网络IP、OS、服务、配置、漏洞 能力需求：定义扫描方式内容和目标信息管理 格式化信息，并进行筛选、分组、定义优先级 能力需求：资产分组、指定所有者、向所有者报告漏洞信息输出 向不同层级的人群展示足够的信息量 能力需求：生成报告、导出数据、与">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://tuchuang-xchcloud-1253428588.cos.ap-chengdu.myqcloud.com/blog/openvas.png">
<meta property="og:updated_time" content="2018-10-28T12:43:37.847Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Kali-linux漏洞扫描入门">
<meta name="twitter:description" content="发现漏洞 基于端口服务扫描结果版本信息（速度慢） 搜索已公开的漏洞数据库（数量大） 使用弱点扫描器实现漏洞管理  从信息的维度定义漏洞管理信息收集： 扫描发现网络IP、OS、服务、配置、漏洞 能力需求：定义扫描方式内容和目标信息管理 格式化信息，并进行筛选、分组、定义优先级 能力需求：资产分组、指定所有者、向所有者报告漏洞信息输出 向不同层级的人群展示足够的信息量 能力需求：生成报告、导出数据、与">
<meta name="twitter:image" content="https://tuchuang-xchcloud-1253428588.cos.ap-chengdu.myqcloud.com/blog/openvas.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"always","offset":12,"offset_float":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: false,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://xchcloud.cn/Kali-linux漏洞扫描入门/"/>





  <title>Kali-linux漏洞扫描入门 | 超哥记录日记</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b8d23512908ca3b4b175b2620a75740f";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">超哥记录日记</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <h1 class="site-subtitle" itemprop="description">生命有息、学无止境、折腾不止</h1>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://xchcloud.cn/Kali-linux漏洞扫描入门/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="John Doe">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="https://tuchuang-xchcloud-1253428588.cos.ap-chengdu.myqcloud.com/blog/header.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="超哥记录日记">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">Kali-linux漏洞扫描入门</h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-10-10T21:00:54+08:00">
                2018-10-10
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/kali/" itemprop="url" rel="index">
                    <span itemprop="name">kali</span>
                  </a>
                </span>

                
                
              
            </span>
          

 


          
            
          

          
          

          
            <span class="post-meta-divider">|</span>
            <span class="page-pv"><i class="fa fa-file-o">访问数</i>
            <span class="busuanzi-value" id="busuanzi_value_page_pv" ></span>°C
            </span>
          

          
            <div class="post-wordcount">
              
                
                <span class="post-meta-item-icon">
                  <i class="fa fa-file-word-o"></i>
                </span>
                
                  <span class="post-meta-item-text">字数统计</span>
                
                <span title="字数统计">
                  2,094
                </span>
              

              
                <span class="post-meta-divider">|</span>
              

              
                <span class="post-meta-item-icon">
                  <i class="fa fa-clock-o"></i>
                </span>
                
                  <span class="post-meta-item-text">阅读时长</span>
                
                <span title="阅读时长">
                  8
                </span>
              
            </div>
          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="发现漏洞"><a href="#发现漏洞" class="headerlink" title="发现漏洞"></a>发现漏洞</h2><ul>
<li>基于端口服务扫描结果版本信息（速度慢）</li>
<li>搜索已公开的漏洞数据库（数量大）</li>
<li>使用弱点扫描器实现漏洞管理</li>
</ul>
<h2 id="从信息的维度定义漏洞管理"><a href="#从信息的维度定义漏洞管理" class="headerlink" title="从信息的维度定义漏洞管理"></a>从信息的维度定义漏洞管理</h2><h3 id="信息收集："><a href="#信息收集：" class="headerlink" title="信息收集："></a>信息收集：</h3><ul>
<li>扫描发现网络IP、OS、服务、配置、漏洞</li>
<li>能力需求：定义扫描方式内容和目标<h3 id="信息管理"><a href="#信息管理" class="headerlink" title="信息管理"></a>信息管理</h3></li>
<li>格式化信息，并进行筛选、分组、定义优先级</li>
<li>能力需求：资产分组、指定所有者、向所有者报告漏洞<h3 id="信息输出"><a href="#信息输出" class="headerlink" title="信息输出"></a>信息输出</h3></li>
<li>向不同层级的人群展示足够的信息量</li>
<li>能力需求：生成报告、导出数据、与SIEM集成</li>
</ul>
<h2 id="弱点扫描类型"><a href="#弱点扫描类型" class="headerlink" title="弱点扫描类型"></a>弱点扫描类型</h2><h3 id="主动扫描"><a href="#主动扫描" class="headerlink" title="主动扫描"></a>主动扫描</h3><ul>
<li>有身份验证</li>
<li>无身份验证<h3 id="被动扫描"><a href="#被动扫描" class="headerlink" title="被动扫描"></a>被动扫描</h3></li>
<li>镜像端口抓包</li>
<li>其他来源输入<h3 id="基于Agent的扫描"><a href="#基于Agent的扫描" class="headerlink" title="基于Agent的扫描"></a>基于Agent的扫描</h3></li>
<li>支持平台有限</li>
</ul>
<h2 id="漏洞基本概念"><a href="#漏洞基本概念" class="headerlink" title="漏洞基本概念"></a>漏洞基本概念</h2><h3 id="CVSS（Common-Vulnerability-Scoring-System）"><a href="#CVSS（Common-Vulnerability-Scoring-System）" class="headerlink" title="CVSS（Common Vulnerability Scoring System）"></a>CVSS（Common Vulnerability Scoring System）</h3><ul>
<li>通用漏洞评分系统——工业标准</li>
<li>描述安全漏洞严重程度的统一评分方案</li>
<li>V 3版本——2015年6月10日</li>
<li>Basic Metric：基础的恒定不变的弱点权重</li>
<li>Temporal Metric：依赖时间因素的弱点权重</li>
<li>Enviromental Metric：利用弱点的环境要求和实施难度的权重<br>CVSS是安全内容自动化协议（SCAP）的一部分</li>
<li>通常CVSS与CVE一同由美国国家漏洞库（NVD）发布并保持数据的更新</li>
<li>分值范围：0 —— 10</li>
<li>不同机构按CVSS分值定义威胁的中、高、低威胁级别</li>
<li>CVSS体现弱点的风险，威胁级别（severity）表示弱点风险对企业的影响程度</li>
<li>CVSS分值是工业标准，但威胁级别不是<h3 id="Vulnerability-Reference"><a href="#Vulnerability-Reference" class="headerlink" title="Vulnerability Reference"></a>Vulnerability Reference</h3><h3 id="CVE（-Common-Vulnerabilities-and-Exposures-）"><a href="#CVE（-Common-Vulnerabilities-and-Exposures-）" class="headerlink" title="CVE（ Common Vulnerabilities and Exposures ）"></a>CVE（ Common Vulnerabilities and Exposures ）</h3></li>
<li>已公开的信息安全漏洞字典，统一的漏洞编号标准</li>
<li>MITRE公司负责维护（非盈利机构）</li>
<li>扫描器的大部分扫描项都对应一个CVE编号</li>
<li>实现不同厂商之间信息交换的统一标准</li>
<li>CVE发布流程</li>
<li>发现漏洞</li>
<li>CAN负责指定CVE ID</li>
<li>发布到CVE List —— CVE-2008-4250</li>
<li>MITRE负责对内容进行编辑维护</li>
</ul>
<h3 id="很多厂商维护自己的Vulnerability-Reference"><a href="#很多厂商维护自己的Vulnerability-Reference" class="headerlink" title="很多厂商维护自己的Vulnerability Reference"></a>很多厂商维护自己的Vulnerability Reference</h3><ul>
<li>MS –微软</li>
<li>MSKB  – 补丁</li>
<li>其他Vulnerability Reference</li>
<li><ul>
<li>CERT TA08-297A</li>
</ul>
</li>
<li>BID 31874</li>
<li>IAVM 2008-A-0081</li>
<li>OVAL OVAL6093</li>
</ul>
<h4 id="OVAL（Open-Vulnerability-and-Assessment-Language）"><a href="#OVAL（Open-Vulnerability-and-Assessment-Language）" class="headerlink" title="OVAL（Open Vulnerability and Assessment Language）"></a>OVAL（Open Vulnerability and Assessment Language）</h4><ul>
<li>描述漏洞检测方法的机器可识别语言</li>
<li>详细的描述漏洞检测的技术细节，可导入自动化检测工具中实施漏洞检测工作</li>
<li>OVAL使用XML语言描述，包含了严密的语法逻辑<h4 id="CCE"><a href="#CCE" class="headerlink" title="CCE"></a>CCE</h4></li>
<li>描述软件配置缺陷的一种标准化格式</li>
<li>在信息安全风险评估中，配置缺陷的检测是一项重要内容，使用CCE可以让配置缺陷以标准的方式<br>展现出来，便于配置缺陷评估的可量化操作。<h4 id="CPE（Common-Product-Enumeration）"><a href="#CPE（Common-Product-Enumeration）" class="headerlink" title="CPE（Common Product Enumeration）"></a>CPE（Common Product Enumeration）</h4></li>
<li>信息技术产品、系统、软件包的结构化命名规范，分类命名<h4 id="CWE（Common-Weakness-Enumeration）"><a href="#CWE（Common-Weakness-Enumeration）" class="headerlink" title="CWE（Common Weakness Enumeration）"></a>CWE（Common Weakness Enumeration）</h4></li>
<li>常见漏洞类型的字典，描述不同类型漏洞的特征（访问控制、信息泄露、拒绝服务）<br>Security Content Automation Protocol (SCAP)</li>
<li><ul>
<li>SCAP 是一个集合了多种安全标准框架</li>
</ul>
</li>
<li><ul>
<li>六个元素：CVE、OVAL、CCE、CPE、 CVSS、XCCDF</li>
</ul>
</li>
<li><ul>
<li>目的是以标准的方法展示和操作安全数据</li>
</ul>
</li>
<li><ul>
<li>由NIST负责维护</li>
</ul>
</li>
<li>SCAP主要解决三个问题</li>
<li><ul>
<li>实现高层政策法规等到底层实施的落地（如FISMA，ISO27000系列）</li>
</ul>
</li>
<li><ul>
<li>将信息安全所涉及的各个要素标准化（如统一漏洞的命名及严重性度量）</li>
</ul>
</li>
<li><ul>
<li>将复杂的系统配置核查工作自动化</li>
</ul>
</li>
<li>SCAP是当前美国比较成熟的一套信息安全评估标准体系，其标准化、自动化的思想对信息安全行业产生了深远的影响。</li>
</ul>
<h4 id="NVD（National-Vulnerability-Database）"><a href="#NVD（National-Vulnerability-Database）" class="headerlink" title="NVD（National Vulnerability Database）"></a>NVD（National Vulnerability Database）</h4><ul>
<li>美国政府的漏洞管理标准数据</li>
<li>完全基于SCAP框架</li>
<li>实现自动化漏洞管理、安全测量、合规要求</li>
<li>包含以下库</li>
<li>安全检查列表</li>
<li>软件安全漏洞</li>
<li>配置错误</li>
<li>产品名称</li>
<li>影响度量</li>
<li><a href="https://nvd.nist.gov/" target="_blank" rel="noopener">https://nvd.nist.gov/</a></li>
</ul>
<h4 id="NMAP"><a href="#NMAP" class="headerlink" title="NMAP"></a>NMAP</h4><ul>
<li>nmap 扫描脚本</li>
<li><ul>
<li>400+</li>
</ul>
</li>
<li><ul>
<li>分类</li>
</ul>
</li>
<li>cat /usr/share/nmap/scripts/script.db</li>
<li>grep vuln /usr/share/nmap/scripts/script.db| cut -d “\”” -f 2</li>
<li>cat /usr/share/nmap/scripts/smb-check-vulns.nse</li>
<li>smb-check-vulns.nse</li>
<li><ul>
<li>nmap -sU -sS –script=smb-check-vulns.nse –script-args=unsafe=1 -p U:137,T:139,445 1.1.1.1</li>
</ul>
</li>
<li><ul>
<li>MS08-067<h5 id="smb-vuln-ms10-061-nse"><a href="#smb-vuln-ms10-061-nse" class="headerlink" title="smb-vuln-ms10-061.nse"></a>smb-vuln-ms10-061.nse</h5></li>
</ul>
</li>
<li>Stuxnet蠕虫利用的4个漏洞之一</li>
<li>Print Spooler权限不当，打印请求可在系统目录可创建文件、执行任意代码</li>
<li>LANMAN API枚举共享打印机</li>
<li>远程共享打印机名称</li>
<li>smb-enum-shares枚举共享</li>
<li><ul>
<li>身份认证参数——smbuser、smbpassword</li>
</ul>
</li>
<li><ul>
<li>nmap -p445 –script=smb-enum-shares.nse –script-args=smbuser=admin,smbpassword=pass<br>1.1.1.1</li>
</ul>
</li>
<li>Windows XP,Server 2003 SP2,Vista,Server 2008, win 7<h5 id="其他资料收集"><a href="#其他资料收集" class="headerlink" title="其他资料收集"></a>其他资料收集</h5></li>
<li>简介：NMap也就是Network Mapper，最早是Linux下的网络扫描和嗅探工具包。</li>
<li>中文手册 <a href="http://www.nmap.com.cn/doc/manual.shtm" target="_blank" rel="noopener">链接</a></li>
<li>英文手册 <a href="https://nmap.org/book/man.html" target="_blank" rel="noopener">链接</a></li>
<li>优秀博客：</li>
<li><ul>
<li><a href="https://www.cnblogs.com/nmap/p/6232207.html" target="_blank" rel="noopener">nmap命令—–基础用法</a></li>
</ul>
</li>
<li><ul>
<li><a href="https://www.cnblogs.com/nmap/p/6232969.html" target="_blank" rel="noopener">nmap命令—–高级用法</a></li>
</ul>
</li>
</ul>
<h2 id="OPENVAS相关"><a href="#OPENVAS相关" class="headerlink" title="OPENVAS相关"></a>OPENVAS相关</h2><p>OpenVAS 是开放式漏洞评估系统，也可以说它是一个包含着相关工具的网络扫描器。其核心部件是一个服务器，包括一套网络漏洞测试程序，可以检测远程系统和应用程序中的安全问题。</p>
<p>用户需要一种自动测试的方法，并确保正在运行一种最恰当的最新测试。OpenVAS 包括一个中央服务器和一个图形化的前端。这个服务器准许用户运行 几种不同的网络漏洞测试（以 Nessus 攻击脚本语言编写），而且 OpenVAS 可以经常对其进行更新。OpenVAS 所有的代码都符合 GPL 规范。</p>
<h3 id="构造图："><a href="#构造图：" class="headerlink" title="构造图："></a>构造图：</h3><p><img src="https://tuchuang-xchcloud-1253428588.cos.ap-chengdu.myqcloud.com/blog/openvas.png" alt="结构图"></p>
<h3 id="介绍"><a href="#介绍" class="headerlink" title="介绍"></a>介绍</h3><h4 id="OpenVAS-Manager"><a href="#OpenVAS-Manager" class="headerlink" title="OpenVAS Manager"></a>OpenVAS Manager</h4><ul>
<li>控制scanner和其他manager的中心组件</li>
<li>控制中心数据库，保存用户配置及扫描结果</li>
<li>客户端使用基于XML的无状态OMP协议与其通信</li>
<li>集中排序筛选，使客户端获得一致展现<h4 id="OpenVAS-Scanner"><a href="#OpenVAS-Scanner" class="headerlink" title="OpenVAS Scanner"></a>OpenVAS Scanner</h4></li>
<li>具体执行Network Vulnerability Tests （NVTs）</li>
<li>NVTs 每天通过 Feed 更新</li>
<li>受 Manager 控制<h4 id="OSP-Scanner"><a href="#OSP-Scanner" class="headerlink" title="OSP Scanner"></a>OSP Scanner</h4></li>
<li>可以统一管理多个scanner</li>
<li>将一组 scanner 作为一个对象交给manager管理<h4 id="Greenbone-Security-Assistant-GSA"><a href="#Greenbone-Security-Assistant-GSA" class="headerlink" title="Greenbone Security Assistant (GSA)"></a>Greenbone Security Assistant (GSA)</h4></li>
<li>提供 Web service<h4 id="OpenVAS-CLI"><a href="#OpenVAS-CLI" class="headerlink" title="OpenVAS CLI"></a>OpenVAS CLI</h4></li>
<li>omp 命令行工具，可实现批处理控制 manager<h4 id="更新很快"><a href="#更新很快" class="headerlink" title="更新很快"></a>更新很快</h4></li>
<li>所有找得到的资料几乎都已不同程度的过时了</li>
</ul>
<h3 id="使用步骤"><a href="#使用步骤" class="headerlink" title="使用步骤"></a>使用步骤</h3><p>安装</p>
<ul>
<li>初始化安装</li>
<li>openvas-setup</li>
<li>检查安装结果</li>
<li>openvas-check-setup</li>
<li>查看当前账号</li>
<li>openvasmd–list-users</li>
<li>修改账号密码</li>
<li>openvasmd–user=admin –new-password=Passw0rd</li>
<li>升级</li>
<li>openvas-feed-update<br>创建证书<br>同步弱点数据库<br>创建客户端证书<br>重建数据库<br>备份数据库<br>启动服务装入插件<br>创建管理员账号<br>创建普通用户账号<br>配置服务侦听端口<br>安装验证</li>
</ul>
<h2 id="NESSUS"><a href="#NESSUS" class="headerlink" title="NESSUS"></a>NESSUS</h2><ul>
<li>家庭版</li>
<li><ul>
<li>免费</li>
</ul>
</li>
<li>专业版</li>
<li><ul>
<li>收费、无限的并发连接<h4 id="1-下载"><a href="#1-下载" class="headerlink" title="1.下载"></a>1.下载</h4></li>
</ul>
</li>
<li><a href="http://www.tenable.com/products/nessus/select-your-operating-system" target="_blank" rel="noopener">http://www.tenable.com/products/nessus/select-your-operating-system</a><h4 id="2-安装"><a href="#2-安装" class="headerlink" title="2.安装"></a>2.安装</h4></li>
<li><ul>
<li>dpkg –i</li>
</ul>
</li>
<li>安装路径：</li>
<li><ul>
<li>/opt/nessus<h4 id="3-启动服务"><a href="#3-启动服务" class="headerlink" title="3.启动服务"></a>3.启动服务</h4></li>
</ul>
</li>
<li><ul>
<li>/etc/init.d/nessusd start<h4 id="4-管理地址"><a href="#4-管理地址" class="headerlink" title="4.管理地址"></a>4.管理地址</h4></li>
</ul>
</li>
<li><a href="https://127.0.0.1:8834" target="_blank" rel="noopener">https://127.0.0.1:8834</a><h4 id="5-注册激活码"><a href="#5-注册激活码" class="headerlink" title="5.注册激活码"></a>5.注册激活码</h4></li>
<li><a href="http://www.tenable.com/products/nessus-home" target="_blank" rel="noopener">http://www.tenable.com/products/nessus-home</a><h4 id="6-管理账号"><a href="#6-管理账号" class="headerlink" title="6.管理账号"></a>6.管理账号</h4></li>
<li>更新插件<h4 id="7-基本配置（setting）"><a href="#7-基本配置（setting）" class="headerlink" title="7.基本配置（setting）"></a>7.基本配置（setting）</h4></li>
<li>升级</li>
<li>账号</li>
<li>SMTP</li>
<li>代理<h4 id="8-实战"><a href="#8-实战" class="headerlink" title="8.实战"></a>8.实战</h4></li>
<li>策略</li>
<li>扫描</li>
<li>扫描本机</li>
<li>扫描windows</li>
<li>扫描linux</li>
<li>扫描网络设备</li>
<li>扫描web server</li>
<li>报告</li>
<li>调度</li>
</ul>
<h2 id="openvas、nessus实战笔记"><a href="#openvas、nessus实战笔记" class="headerlink" title="openvas、nessus实战笔记"></a>openvas、nessus实战笔记</h2><h3 id="好教程"><a href="#好教程" class="headerlink" title="好教程"></a>好教程</h3><p>大学霸 Kali Linux 安全渗透教程：<a href="https://wizardforcel.gitbooks.io/daxueba-kali-linux-tutorial/content/28.html" target="_blank" rel="noopener">https://wizardforcel.gitbooks.io/daxueba-kali-linux-tutorial/content/28.html</a></p>
<h3 id="个人笔记"><a href="#个人笔记" class="headerlink" title="个人笔记"></a>个人笔记</h3><p>nessus 版本分linux和win，在linux版本中针对不同内核、不同处理器，版本也各部相同。<br>首次使用注意保存启动命令方式。（见上文）<br>创建目标主机，步骤很简单，很容易上手。<br>扫描之前创建一个靶机，用于漏洞扫描，靶机推荐 Metasploitable 操作系统，该操作系统存在大量未修补漏洞。<br>实战：<br>扫描了虚拟机的靶机和自己的两台服务器，效果明显，针对高版本服务器，漏洞的出现率非常低。</p>
<p>openvas  一直出现404错误，原因不知。尝试了下，可以用，体验不是太好。提供ssh与不提供ssh效果明显不同。</p>
<h5 id="用到的链接："><a href="#用到的链接：" class="headerlink" title="用到的链接："></a>用到的链接：</h5><p><a href="https://blog.csdn.net/qq_35983015/article/details/79325463" target="_blank" rel="noopener">Linux安装Nessus的详细操作</a><br><a href="https://www.cnblogs.com/yxwkf/p/5348042.html" target="_blank" rel="noopener">win下的Nessus漏洞扫描教程之配置Nessus</a></p>
<h5 id="漏洞的处理："><a href="#漏洞的处理：" class="headerlink" title="漏洞的处理："></a>漏洞的处理：</h5><p><a href="https://www.jb51.net/article/33938.htm" target="_blank" rel="noopener">如何关闭http Methods中的Trace 提高安全意识</a></p>

      
    </div>
    
    
    

      <div>
  
    <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>

  
</div>

<div>
      
        
<div class="my_post_copyright">
  <script src="//cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js"></script>
  
  <!-- JS库 sweetalert 可修改路径 -->
  <script src="https://cdn.bootcss.com/jquery/2.0.0/jquery.min.js"></script>
  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
  <p><span>本文标题:</span><a href="/Kali-linux漏洞扫描入门/">Kali-linux漏洞扫描入门</a></p>
  <p><span>文章作者:</span></a>Chao</p>
  <p><span>发布时间:</span>2018年10月10日 - 21:10</p>
  <p><span>最后更新:</span>2018年10月28日 - 20:10</p>
  <p><span>原始链接:</span><a href="/Kali-linux漏洞扫描入门/" title="Kali-linux漏洞扫描入门">http://xchcloud.cn/Kali-linux漏洞扫描入门/</a>
    <span class="copy-path"  title="点击复制文章链接"><i class="fa fa-clipboard" data-clipboard-text="http://xchcloud.cn/Kali-linux漏洞扫描入门/"  aria-label="复制成功！"></i></span>
  </p>
  <p><span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank" title="Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)">署名-非商业性使用-禁止演绎 4.0 国际</a> 转载请保留原文链接及作者。</p>  
</div>
<script> 
    var clipboard = new Clipboard('.fa-clipboard');
      $(".fa-clipboard").click(function(){
      clipboard.on('success', function(){
        swal({   
          title: "",   
          text: '复制成功',
          icon: "success", 
          showConfirmButton: true
          });
        });
    });  
</script>

      
</div>

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/入门/" <i class="fa fa-tag"></i> 入门</a>
          
            <a href="/tags/kali/" <i class="fa fa-tag"></i> kali</a>
          
            <a href="/tags/漏洞扫描/" <i class="fa fa-tag"></i> 漏洞扫描</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/java-web-会话及其会话技术/" rel="next" title="java-web-会话及其会话技术">
                <i class="fa fa-chevron-left"></i> java-web-会话及其会话技术
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/算法学习笔记-入门级/" rel="prev" title="算法学习笔记-入门级">
                算法学习笔记-入门级 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="https://tuchuang-xchcloud-1253428588.cos.ap-chengdu.myqcloud.com/blog/header.jpg"
               alt="John Doe" />
          </span></a>Chao</p>


           
              <p class="site-description motion-element" itemprop="description"></p>
           
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives/">
                <span class="site-state-item-count">60</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">33</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">65</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/lhc0101" target="_blank" title="Github">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                    
                      Github
                    
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=qJmcmp_akJ6ZmZHo2dmGy8fF" target="_blank" title="E-mail">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                    
                      E-mail
                    
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              dalao&nbsp;
              <i class="fa  fa-fw fa-globe"></i>
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://giracle.cn" title="DJG" target="_blank">DJG</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://owencxc.github.io" title="CX" target="_blank">CX</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://www.myzwl.win" title="ZWL" target="_blank">ZWL</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://wuliekun.me/" title="WLK" target="_blank">WLK</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="https://Li-rr.github.io" title="LRR" target="_blank">LRR</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://dh.xchcloud.cn" title="导航" target="_blank">导航</a>
                </li>
              
            </ul>
+        <div id="days"></div>
</script>
<script language="javascript">
function show_date_time(){
window.setTimeout("show_date_time()", 1000);
BirthDay=new Date("06/26/2018 12:00:00");
today=new Date();
timeold=(today.getTime()-BirthDay.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(e_daysold-daysold)*24;
hrsold=setzero(Math.floor(e_hrsold));
e_minsold=(e_hrsold-hrsold)*60;
minsold=setzero(Math.floor((e_hrsold-hrsold)*60));
seconds=setzero(Math.floor((e_minsold-minsold)*60));
document.getElementById('days').innerHTML="已运行"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒";
}
function setzero(i){
if (i<10)
{i="0" + i};
return i;
}
show_date_time();
</script>

          </div>
         

-        <div id="days"></div>
</script>
<script language="javascript">
function show_date_time(){
window.setTimeout("show_date_time()", 1000);
BirthDay=new Date("06/26/2018 12:00:00");
today=new Date();
timeold=(today.getTime()-BirthDay.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay
daysold=Math.floor(e_daysold);
e_hrsold=(e_daysold-daysold)*24;
hrsold=setzero(Math.floor(e_hrsold));
e_minsold=(e_hrsold-hrsold)*60;
minsold=setzero(Math.floor((e_hrsold-hrsold)*60));
seconds=setzero(Math.floor((e_minsold-minsold)*60));
document.getElementById('days').innerHTML="已运行"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒";
}
function setzero(i){
if (i<10)
{i="0" + i};
return i;
}
show_date_time();
</script>


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#发现漏洞"><span class="nav-number">1.</span> <span class="nav-text">发现漏洞</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#从信息的维度定义漏洞管理"><span class="nav-number">2.</span> <span class="nav-text">从信息的维度定义漏洞管理</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#信息收集："><span class="nav-number">2.1.</span> <span class="nav-text">信息收集：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#信息管理"><span class="nav-number">2.2.</span> <span class="nav-text">信息管理</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#信息输出"><span class="nav-number">2.3.</span> <span class="nav-text">信息输出</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#弱点扫描类型"><span class="nav-number">3.</span> <span class="nav-text">弱点扫描类型</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#主动扫描"><span class="nav-number">3.1.</span> <span class="nav-text">主动扫描</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#被动扫描"><span class="nav-number">3.2.</span> <span class="nav-text">被动扫描</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#基于Agent的扫描"><span class="nav-number">3.3.</span> <span class="nav-text">基于Agent的扫描</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#漏洞基本概念"><span class="nav-number">4.</span> <span class="nav-text">漏洞基本概念</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#CVSS（Common-Vulnerability-Scoring-System）"><span class="nav-number">4.1.</span> <span class="nav-text">CVSS（Common Vulnerability Scoring System）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Vulnerability-Reference"><span class="nav-number">4.2.</span> <span class="nav-text">Vulnerability Reference</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#CVE（-Common-Vulnerabilities-and-Exposures-）"><span class="nav-number">4.3.</span> <span class="nav-text">CVE（ Common Vulnerabilities and Exposures ）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#很多厂商维护自己的Vulnerability-Reference"><span class="nav-number">4.4.</span> <span class="nav-text">很多厂商维护自己的Vulnerability Reference</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#OVAL（Open-Vulnerability-and-Assessment-Language）"><span class="nav-number">4.4.1.</span> <span class="nav-text">OVAL（Open Vulnerability and Assessment Language）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#CCE"><span class="nav-number">4.4.2.</span> <span class="nav-text">CCE</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#CPE（Common-Product-Enumeration）"><span class="nav-number">4.4.3.</span> <span class="nav-text">CPE（Common Product Enumeration）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#CWE（Common-Weakness-Enumeration）"><span class="nav-number">4.4.4.</span> <span class="nav-text">CWE（Common Weakness Enumeration）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#NVD（National-Vulnerability-Database）"><span class="nav-number">4.4.5.</span> <span class="nav-text">NVD（National Vulnerability Database）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#NMAP"><span class="nav-number">4.4.6.</span> <span class="nav-text">NMAP</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#smb-vuln-ms10-061-nse"><span class="nav-number">4.4.6.1.</span> <span class="nav-text">smb-vuln-ms10-061.nse</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#其他资料收集"><span class="nav-number">4.4.6.2.</span> <span class="nav-text">其他资料收集</span></a></li></ol></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#OPENVAS相关"><span class="nav-number">5.</span> <span class="nav-text">OPENVAS相关</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#构造图："><span class="nav-number">5.1.</span> <span class="nav-text">构造图：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#介绍"><span class="nav-number">5.2.</span> <span class="nav-text">介绍</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#OpenVAS-Manager"><span class="nav-number">5.2.1.</span> <span class="nav-text">OpenVAS Manager</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#OpenVAS-Scanner"><span class="nav-number">5.2.2.</span> <span class="nav-text">OpenVAS Scanner</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#OSP-Scanner"><span class="nav-number">5.2.3.</span> <span class="nav-text">OSP Scanner</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#Greenbone-Security-Assistant-GSA"><span class="nav-number">5.2.4.</span> <span class="nav-text">Greenbone Security Assistant (GSA)</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#OpenVAS-CLI"><span class="nav-number">5.2.5.</span> <span class="nav-text">OpenVAS CLI</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#更新很快"><span class="nav-number">5.2.6.</span> <span class="nav-text">更新很快</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#使用步骤"><span class="nav-number">5.3.</span> <span class="nav-text">使用步骤</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#NESSUS"><span class="nav-number">6.</span> <span class="nav-text">NESSUS</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#1-下载"><span class="nav-number">6.0.1.</span> <span class="nav-text">1.下载</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#2-安装"><span class="nav-number">6.0.2.</span> <span class="nav-text">2.安装</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-启动服务"><span class="nav-number">6.0.3.</span> <span class="nav-text">3.启动服务</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#4-管理地址"><span class="nav-number">6.0.4.</span> <span class="nav-text">4.管理地址</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#5-注册激活码"><span class="nav-number">6.0.5.</span> <span class="nav-text">5.注册激活码</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#6-管理账号"><span class="nav-number">6.0.6.</span> <span class="nav-text">6.管理账号</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#7-基本配置（setting）"><span class="nav-number">6.0.7.</span> <span class="nav-text">7.基本配置（setting）</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#8-实战"><span class="nav-number">6.0.8.</span> <span class="nav-text">8.实战</span></a></li></ol></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#openvas、nessus实战笔记"><span class="nav-number">7.</span> <span class="nav-text">openvas、nessus实战笔记</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#好教程"><span class="nav-number">7.1.</span> <span class="nav-text">好教程</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#个人笔记"><span class="nav-number">7.2.</span> <span class="nav-text">个人笔记</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#用到的链接："><span class="nav-number">7.2.0.1.</span> <span class="nav-text">用到的链接：</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#漏洞的处理："><span class="nav-number">7.2.0.2.</span> <span class="nav-text">漏洞的处理：</span></a></li></ol></li></ol></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Chao</span>
</div>



<div class="theme-info">
  <span class="post-count">博客全站共118.7k字</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

  
    <span class="site-uv">
      <i class="fa fa-user">访客数</i>
      <span class="busuanzi-value" id="busuanzi_value_site_uv"></span>
      人
    </span>
  

  
    <span class="site-pv">
      <i class="fa fa-eye">访客总量</i>
      <span class="busuanzi-value" id="busuanzi_value_site_pv"></span>
      次
    </span>
  
</div>


        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  




  
  









  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>

  
  <script type="text/javascript" src="/lib/three/three.min.js"></script>

  
  <script type="text/javascript" src="/lib/three/three-waves.min.js"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.2"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.2"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.2"></script>



  


  




	





  





  






  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  

  
  <script type="text/javascript" src="/js/src/js.cookie.js?v=5.1.2"></script>
  <script type="text/javascript" src="/js/src/scroll-cookie.js?v=5.1.2"></script>


  

  

</body>
</html>
